// 编写第一个mobx案例
import { makeAutoObservable, computed } from 'mobx'

export default class ListStore {
  list = [1, 2, 3, 4, 5, 6, 7, 8, 9];
  constructor() {
    makeAutoObservable(this), {
      filterList: computed
    }
  }

  addList = () => {
    this.list.push(11, 12, 13);
  }

  get filterList() {
    return this.list.filter(item => item > 4)
  }
}